home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ALPH.{_4 / IDE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  120 lines

  1. /*
  2.  *  linux/include/asm-alpha/ide.h
  3.  *
  4.  *  Copyright (C) 1994-1996  Linus Torvalds & authors
  5.  */
  6.  
  7. /*
  8.  *  This file contains the alpha architecture specific IDE code.
  9.  */
  10.  
  11. #ifndef __ASMalpha_IDE_H
  12. #define __ASMalpha_IDE_H
  13.  
  14. #ifdef __KERNEL__
  15.  
  16. typedef unsigned short ide_ioreg_t;
  17.  
  18. #ifndef MAX_HWIFS
  19. #define MAX_HWIFS    4
  20. #endif
  21.  
  22. #define ide__sti()    __sti()
  23.  
  24. static __inline__ int ide_default_irq(ide_ioreg_t base)
  25. {
  26.     switch (base) {
  27.         case 0x1f0: return 14;
  28.         case 0x170: return 15;
  29.         case 0x1e8: return 11;
  30.         case 0x168: return 10;
  31.         default:
  32.             return 0;
  33.     }
  34. }
  35.  
  36. static __inline__ ide_ioreg_t ide_default_io_base(int index)
  37. {
  38.     switch (index) {
  39.         case 0:    return 0x1f0;
  40.         case 1:    return 0x170;
  41.         case 2: return 0x1e8;
  42.         case 3: return 0x168;
  43.         default:
  44.             return 0;
  45.     }
  46. }
  47.  
  48. static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
  49. {
  50.     ide_ioreg_t port = base;
  51.     int i = 8;
  52.  
  53.     while (i--)
  54.         *p++ = port++;
  55.     *p++ = base + 0x206;
  56.     if (irq != NULL)
  57.         *irq = 0;
  58. }
  59.  
  60. typedef union {
  61.     unsigned all            : 8;    /* all of the bits together */
  62.     struct {
  63.         unsigned head        : 4;    /* always zeros here */
  64.         unsigned unit        : 1;    /* drive select number, 0 or 1 */
  65.         unsigned bit5        : 1;    /* always 1 */
  66.         unsigned lba        : 1;    /* using LBA instead of CHS */
  67.         unsigned bit7        : 1;    /* always 1 */
  68.     } b;
  69.     } select_t;
  70.  
  71. static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
  72.             unsigned long flags, const char *device, void *dev_id)
  73. {
  74.     return request_irq(irq, handler, flags, device, dev_id);
  75. }            
  76.  
  77. static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
  78. {
  79.     free_irq(irq, dev_id);
  80. }
  81.  
  82. static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
  83. {
  84.     return check_region(from, extent);
  85. }
  86.  
  87. static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
  88. {
  89.     request_region(from, extent, name);
  90. }
  91.  
  92. static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
  93. {
  94.     release_region(from, extent);
  95. }
  96.  
  97. /*
  98.  * The following are not needed for the non-m68k ports
  99.  */
  100. static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
  101. {
  102.     return(1);
  103. }
  104.  
  105. static __inline__ void ide_fix_driveid(struct hd_driveid *id)
  106. {
  107. }
  108.  
  109. static __inline__ void ide_release_lock (int *ide_lock)
  110. {
  111. }
  112.  
  113. static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data)
  114. {
  115. }
  116.  
  117. #endif /* __KERNEL__ */
  118.  
  119. #endif /* __ASMalpha_IDE_H */
  120.